#ifndef PROCESS_H_
#define PROCESS_H_

#include <iostream>
#include <list>
#include <sstream>
#include <string>
#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>
#include "LogFile.h"
#include "SignalHandler.h"

using namespace std;

class Process {

private:
	list<int> processIds;
	string parentProcessName;

	// Para usar en los logs.
	static string convertToString(int value);

public:
	Process(LogFile* logFile);
	virtual ~Process();

	void start();
	virtual void wait();

	list<int> getProcessIds();

	// Para usar en los logs.
	void setParentProcessName(string parentProcessName);
	string getParentProcessName();

protected:
	LogFile* logFile;
	virtual int doWork() = 0;

	// Para usar en los logs.
	virtual string getProcessName() = 0;
};

#endif /* PROCESS_H_ */
